package com.henry.veterinary;

import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;

public class Registration {
    // 就诊流水号，日期时间，动物编号，病情描述，医生编号
    long registrationID;
    LocalDateTime time;
    String animalID;
    String doctorID;
    String record;

    private static final DateTimeFormatter dateTimeFmt = DateTimeFormatter.ofPattern("yyyy/MM/dd HH:mm:ss");

    public Registration(long registrationID, LocalDateTime time, String animalID, String record, String doctorID) {
        this.registrationID = registrationID;
        this.time = time;
        this.animalID = animalID;
        this.doctorID = doctorID;
        this.record = record;
    }

    public long getRegistrationID() {
        return registrationID;
    }

    public LocalDateTime getTime() {
        return time;
    }

    public String getTimeString() {
        return dateTimeFmt.format(time);
    }

    public static DateTimeFormatter getDateTimeFmt() {
        return dateTimeFmt;
    }

    public String getAnimalID() {
        return animalID;
    }

    public String getDoctorID() {
        return doctorID;
    }

    public String getRecord() {
        return record;
    }

    @Override
    public String toString() {
        return "Registration{" +
                "registrationID=" + registrationID +
                ", time=" + time +
                ", animalID='" + animalID + '\'' +
                ", doctorID='" + doctorID + '\'' +
                ", record='" + record + '\'' +
                '}';
    }
}
